from sympy.abc import x, y, z
mass1d = [[240, 288, 192, 320, 384, 256, 360, 216,x]]
from sympy import *

def get_a0(n):
    lst = []
    a2 = [i.copy() for i in mass1d]
    for i in a2:
        i[n] = z
        m0 = Matrix(3,3,i)
        md0 = m0.det()
        if md0 ==0:
            lst.append(m0.values())
    return lst

def get_a2():
    lst = []
    for i in range(8):
        lst.extend(get_a0(i))
    print(lst)

get_a2()
